<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<%@ include file="/web/header.jsp"%>
</head>
<body>
<fieldset class="layui-elem-field" style="margin: 10px">
		<legend>修改</legend>
		<div class="layui-field-box">
			<form class="layui-form layui-form-pane" action="" lay-filter="formA">
				<div class="layui-form-item">
					<label class="layui-form-label">&nbsp&nbsp员工编号</label>
					<div class="layui-input-inline">
						<input type="text" name="codeEmp" required lay-verify="required" readonly
							 placeholder="请输入员工编号" autocomplete="off"
							class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">&nbsp&nbsp项目编号</label>
					<div class="layui-input-inline">
						<input type="text" name="codePro" required lay-verify="required"
							placeholder="请输入项目编号" autocomplete="off" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">绩效</label>
					<div class="layui-input-inline">
						<input type="text" name="score" placeholder="请输入员工绩效"
							autocomplete="off" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-input-block">
						<input type="button" value="确定" class="layui-btn" lay-submit
							lay-filter="upd"> <input type="reset" value="重置"
							class="layui-btn layui-btn-primary"> <input type="button"
							value="关闭" class="layui-btn" onclick="layerClose()">
					</div>
				</div>
				<input type="hidden" name="action" value="upd">
			</form>
		</div>
	</fieldset>
	
<script type="text/javascript">
function refresh(){
	$("input[value='查询']").click();
}
refresh();
var codeEmp ='<%=request.getParameter("codeEmp")%>';

function init(){
	ajax("/ScoreServlet",{codeEmp:codeEmp,action:'get'},'json',function(data){
		//console.log(data)
// 		$("input[name='code']").val(data.code);
// 		$("input[name='name']").val(data.name);
// 		$("input[name='tel']").val(data.tel);
		//form.val('formA',{code:data.code,name:data.name,tel:data.tel});
		form.val('formA',data)
	})
}
init();
formSubmit("upd","/ScoreServlet","text",function(data){
	if(data==1){
		 layer.msg("修改成功",layerClose,refresh); 
	}else if(data=="00"){
		 layer.msg("修改失败，没有此员工编号",layerClose,refresh); 	 
	}else if(data=="11"){
		 layer.msg("修改失败，没有此项目编号",layerClose,refresh); 	 
	 }else {
		 layer.msg("修改失败");
	 }
	
	
})
</script>
	
</body>
</html>